<?
function getRemoteFileSize($url){ 
   $parsed = parse_url($url); 
   $host = $parsed["host"]; 
   $fp = @fsockopen($host, 80, $errno, $errstr, 20); 
   if(!$fp)return false; 
   else { 
       @fputs($fp, "HEAD $url HTTP/1.1\r\n"); 
       @fputs($fp, "HOST: $host\r\n"); 
       @fputs($fp, "Connection: close\r\n\r\n"); 
       $headers = ""; 
       while(!@feof($fp))$headers .= @fgets ($fp, 128); 
   } 
   @fclose ($fp); 
   $return = false; 
   $arr_headers = explode("\n", $headers); 
   foreach($arr_headers as $header) { 
       $s = "Content-Length: "; 
       if(substr(strtolower ($header), 0, strlen($s)) == strtolower($s)) { 
           $return = trim(substr($header, strlen($s))); 
           break; 
       } 
   } 
   if($return){ 
              $size = round($return, 2);
        $return = "$size"; 
   } 
   return $return; 
}

echo getRemoteFileSize($_GET['url'])."?";

?>